package com.haiheng.library_base.db

import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.haiheng.library_base.db.converters.BookInfoSubConverter
import kotlinx.android.parcel.Parcelize

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/5/6 0006
 * @Version: 1.0
 */
@Entity(tableName = "book_info", indices = [Index(value = ["barCode"], unique = true)])
@TypeConverters(BookInfoSubConverter::class)
@Parcelize
data class BookInfoBean @JvmOverloads constructor(
    var addUser: String? = null,
    var assetOpenType: Int = 0,
    var author: String? = null,
    var barCode: String? = null,
    var bfUpdatedTime: String? = null,
    var bookDesc: String? = null,
    var bookImgUrl: String? = null,
    var bookKey: String? = null,
    var bookOnShelfStatus: Int = 0, // 正确在架:1 错架:2  不在架:3
    var bookRecordNo: String? = null,
    var bookSInfo:String? = null,
    var bookSpDesc: String? = null,
    var bookTitle: String? = null,
    var bookTop: String? = null,
    var callNumber: String? = null,
    var catalogingYear:String? = null,
    var checkCurrentContainerSubCode: String? = null,
    var checkFixedContainerSubCode: String? = null,
    var circulationStatus: Int = 0,
    var classification: String? = null,
    var createdTime: String? = null,
    var currentContainerId: Int = 0,
   //标记为嵌套实体
//    @Embedded(prefix = "current_") // 为fixedContainerSub字段指定前缀"fixed_"
    var currentContainerSub: BookInfoSub = BookInfoSub(),//当前馆藏位置
    var currentContainerSubId: Int = 0,
    var currentPlaceIndex: Int = 0,
    var docType: String? = null,
    var editUser: String? = null,
    var fixContainerId: Int = 0,
//    @Embedded(prefix = "fixed_") // 为fixedContainerSub字段指定前缀"fixed_"
    var fixedContainerSub: BookInfoSub = BookInfoSub(),//应在馆藏位置
    var fixedContainerSubId: Int = 0,
    var fixedPlaceIndex: Int = 0,
    var hasChangeInfo: Boolean = false,
    var hotNum: Int = 0,
    @PrimaryKey(autoGenerate = true)
    var id: Int = 0,
    @ColumnInfo(defaultValue = "")
    var isbn: String = "",
    var lastInventoryNo: String? = null,
    var lastInventoryTime: String? = null,
    var lastInventoryType: String? = null,
    var lastUpShelfTime: String? = null,
    var onOrgCode: String? = null,
    var orgCode: String? = null,
    var orgLocation: String? = null,
    var outStoreNo: String? = null,
    var preContainerId: Int = 0,
    var preContainerSubId: Int = 0,
    var price: String? = null,
    var publishDate: String? = null,
    var publisher: String? = null,
    var remark: String? = null,
    var seriesItem: String? = null,
    var sysOrgLocation: String? = null,
    var toOrgCode:String? = null,
    var totalAmountOfBorrowed: Int = 0,
    var totalAmountOfRead: Int = 0,
    var upShelfTime: String? = null,
    var customReshelfStatus :Int = 0,// 0 未识别过，正确在架 1 错架 2  不在架 3
    var isSelect : Boolean = false,
    var isRetirment:Boolean = false,//是否是剔旧
    var isAlarmed : Boolean = false,//是否是报警
    var invertoryInfoStatus : Int = 0,//盘点状态
    var misShelvedStatus : Int = 0,//错架整理状
) : Parcelable